package com.example.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.example.service.UserService;

@Controller
@RequestMapping("/")
public class MyController {
	@Autowired
    private UserService userService;
	
	@RequestMapping("index")
	public String index(Model model) {
		model.addAttribute("name", "1234");
		System.err.println("====");
		
		return "index";
	}
    @RequestMapping("getUser/{id}")
    public String GetUser(@PathVariable int id){
    	System.out.println(userService.Sel(id).toString());
        return "info";
    }
}
